package com.demo.dp;

import java.time.Duration;
import java.time.LocalTime;
import java.util.concurrent.TimeUnit;

public class TestDuration {
    public static void main(String[] args) throws InterruptedException {
        LocalTime time1 = LocalTime.now();
        TimeUnit.SECONDS.sleep(3);
        LocalTime time2 = LocalTime.now();
        Duration d1 = Duration.between(time1, time2);
    }
}
